package service;

import model.Classes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class ClassService {
    private ClassesDao dao;
    @Autowired
    public void setClassDao(ClassesDao dao){
        this.dao=dao;
    }
    public boolean deleteClass(String classId){
        return dao.deleteClass(classId)>0;
    }
    public ArrayList<Classes> getClass(String classId){
        return dao.findClassByClassid(classId);
    }
    public ArrayList<Classes> getAllClasses() {
        return dao.getAllClasses();
    }
    public boolean editClass(Classes classes){
        return dao.editClass(classes)>0;
    }
    public boolean addClass(Classes classes){
        return dao.addClass(classes)>0;
    }
}
